<template>
  <div>
    <tb-report
      :schemas="schemas"
      :columns="columns"
      :apiUrl="apiUrl"
      :tableData="tableData"
      :getData="getData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmEstimatePackingListHead/exportQueryByPage",
      schemas: [
        {
          label: "内贸合同号",
          field: "contractNo",
          component: "Input",
          placeholder: "内贸合同号",
          required: false,
          colProps: {},
        },
        {
          label: "批次号",
          field: "batchNo",
          component: "Input",
          placeholder: "批次号",
          required: false,
          colProps: {},
        },
      ],
      columns: [
      { type: 'seq', key: 'seq', width: 50, title: '序号', fixed: 'left', align: 'center' },
  {
    title: '预估一级箱单号',
    field: 'estimateFirstPackingListNo',
    key: 'estimateFirstPackingListNo',
    width: 160,
    align: 'center',
  },
  { title: '项目名称', field: 'programName', align: 'center', width: 120, key: 'programName' },
  {
    title: '内贸合同号',
    field: 'contractNo',
    key: 'contractNo',
    width: 140,
    align: 'center',
  },
  {
    title: '批次号',
    field: 'batchNo',
    key: 'batchNo',

    align: 'center',
    width: 200,
  },
  {
    title: '预计交货日期',
    field: 'planDeliveryDate',
    key: 'planDeliveryDate',

    width: 120,
    align: 'center',
  },
  {
    key: 'loadVesselNumber',
    title: '配载船次',
    field: 'loadVesselNumber',
    width: 120,
    align: 'center',
  },
  {
    title: '预估体积M³',
    field: 'estimatedVolume',
    key: 'estimatedVolume',
    width: 120,
    align: 'center',
  },
  {
    title: '预估毛重Kg',
    field: 'estimatedGrossWeight',
    key: 'estimatedGrossWeight',
    width: 120,
    align: 'center',
  },
  {
    title: '预估箱单状态',
    field: 'estimatedPackingListStatusStr',
    key: 'estimatedPackingListStatusStr',
    width: 120,
    align: 'center',
  },

  { title: '唛头号', field: 'marksNo', key: 'marksNo', width: 150, align: 'center' },
  { title: '商品名称', field: 'goodsName', key: 'goodsName', align: 'center', width: 100 },
  { title: '品牌', field: 'goodsBrand', key: 'goodsBrand', align: 'center', width: 100 },
  { title: '型号', field: 'model', key: 'model', align: 'center', width: 100 },
  { title: '规格', field: 'specification', key: 'specification', align: 'center', width: 100 },
  { title: '包装内总数量', field: 'packageInnerTotalQuantity', key: 'packageInnerTotalQuantity', align: 'center', width: 120 },
  { title: '包装件数', field: 'packageQuantity', key: 'packageQuantity', align: 'center', width: 100 },
  { title: '包装方式', field: 'packingMethod', key: 'packingMethod', align: 'center', width: 100 },
  { title: '长度(m)', field: 'length', key: 'length', align: 'center', width: 100 },
  { title: '宽度(m)', field: 'width', key: 'width', align: 'center', width: 100 },
  { title: '高度(m)', field: 'high', key: 'high', align: 'center', width: 100 },
  { title: '体积(M³)', field: 'volume', key: 'volume', align: 'center', width: 100 },
  { title: '毛重(KG)', field: 'grossWeight', key: 'grossWeight', align: 'center', width: 100 },
  { title: '备注', field: 'remark', key: 'remark', align: 'center', width: 100 },
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
